/**
 * Created by zheng on 2018/1/17.
 */
let BlogDocumentService = require('../service/BlogDocumentService');

exports.addBlogDocument = (req, res) => {
  let data = req.body;
  BlogDocumentService.addBlogDocument(data, (result) => {
    res.json(result);
  })

}

exports.getBlogDocumentById = (req, res) => {
  let data = req.params;
  BlogDocumentService.getBlogDocumentById(data, (result) => {
    res.json(result);
  })
}


exports.getAllBlogDocument = (req, res) => {
  let data = req.params;
  BlogDocumentService.getAllBlogDocument(data, (result) => {
    res.json(result);
  })
}

exports.updateBlogDocument = (req, res) => {
  let data = req.body;
  BlogDocumentService.updateBlogDocument(data, (result) => {
    res.json(result);
  })
}

exports.deleteBlogDocumentById = (req, res) => {
  let data = req.params;
  BlogDocumentService.deleteBlogDocumentById(data, (result) => {
    res.json(result);
  })
}

exports.getBlogDocumentWithNextPage = (req, res) => {
  let data = req.params;
  BlogDocumentService.getBlogDocumentWithNextPage(data, (result) => {
    res.json(result);
  })
}

exports.getBlogDocumentWithPrePage = (req, res) => {
  let data = req.params;
  BlogDocumentService.getBlogDocumentWithPrePage(data, (result) => {
    res.json(result);
  })
}

exports.getBlogDocumentWithPageNumber = (req, res) => {
  let data = req.params;
  BlogDocumentService.getBlogDocumentWithPageNumber(data, (result) => {
    res.json(result);
  })
}

exports.transferImage = (req, res) => {
  let data = req.body;
  BlogDocumentService.transferImage(data, (result) => {
    res.json(result);
  })
}
